import request from '@/utils/request.js'

//获取角色列表
export function getRoleList(data) {
  return request({
    url: '/ScmDo/roleList',
    method: 'post',
    data:data
  })
}

// 获取选中角色
export function getRoleOne(usercode) {
  return request({
    url:`/ScmDo/roleList?usercode=${usercode}`,
    method: 'get'
  })
}

//增加角色
export function addRole(data) {
  return request({
    url: '/ScmDo/roleAdd',
    method: 'post',
    data:data
  })
}

//编辑
export function editRole(data) {
  return request({
    url: '/ScmDo/roleEdit',
    method: 'post',
    data:data
  })
}

//删除角色
export function delRole(ids){
  return request({
    url:`/ScmDo/roleDel?id=${ids}`,
    method:'get'
  })
}